//! @file   lc_thread_storage.h
//! @brief  
//! @author Sayan Chaliha
//! @date   September, 2011
//!
//! 
#ifndef _LC_THREAD_STORAGE_H
#define _LC_THREAD_STORAGE_H

#include "libcyan_internal.h"
#include "lc_types.h"
#include "lc_object.h"

namespace cyan {
  template <typename T>
  class ThreadStorage;

#include "lc_thread_storage_pthread.h"

  template <typename T>
  class CYAN_API ThreadStorage : public Object {
  public:
    typedef T   ValueType;

    ThreadStorage() {
    }

    virtual ~ThreadStorage() {
    }

    ValueType data() const {
      return reinterpret_cast<T>(this->data_.data());
    }

    void data(ValueType value) {
      this->data_.data(reinterpret_cast<void*>(value));
    }

  private:
    ThreadStorage(const ThreadStorage&);
    ThreadStorage& operator =(const ThreadStorage&);

    ThreadStorage<void*> data_;
  };
}

#endif /* _LC_THREAD_STORAGE_H */
